<?php


namespace app\api\validate;


class IdCollection extends baseValidate {
    protected $rule = array('ids'=>'require|checkIds');

    protected $message = array('ids'=>'ids必须是以逗号隔开的多个正整数');

    public function checkIds($value){
        $ids = explode(',',$value);
        if(empty($ids)){
            return false;
        }

        foreach ($ids as $id){
            if(!$this->isInteger($id,'','','')){
                return false;
            }
        }

        return true;

    }



}





